/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.amu.wmi.kino.visualjavafx.javafxcodeparsers.tools;

import java.util.ArrayList;

/**
 *
 * @author Admin
 */
//TODO : Grzegorz : finish implementing it
public class MyInstructionDivider {
    int i=0;

     public synchronized Object[] divide(String in){
        int end = in.length();
        ArrayList<Object> arr = new ArrayList<Object>();
        String tmp = new String();
        while(i<end){

            if(in.regionMatches(i, "//", 0, 2)){
                while( (in.charAt(i)!='\n'&&i<end))
                    i++;
                i++;
            }
            else if(in.regionMatches(i, "/*", 0, 2)){                          //multiline comments as well
                while (i<end && !(in.regionMatches(i, "*/", 0, 2)) ){
                    i++;
                }
                i++;
                i++;
            }
            else if(in.charAt(i)==';'){
                tmp=tmp+in.charAt(i);
                arr.add(tmp);
                tmp=new String();
                i++;
            }
            else if((in.charAt(i)=='{')&&i<end)
                i++;
           
     }
         return null;
}
}
